//
//  YD_CommonTool.h
//  StudyLawApp
//
//  Created by 如沐春风 on 2020/5/13.
//  Copyright © 2020 永东科技. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface YD_CommonTool : NSObject
+(instancetype)Instance;

/**
 *首页图片宽高比
 */
@property(nonatomic ,assign)CGFloat homeRate;
/**
 *个人中心图片宽高比
 */
@property(nonatomic ,assign)CGFloat mineRate;

/**
 * 计算文本尺寸
 */
+ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font;
/**
 *  计算限定宽度文本尺寸
 */
+ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font maxW:(CGFloat)maxW;
/**
 *  计算限定宽度文本尺寸附加行高
 */
+ (CGFloat)getSpaceLabelHeight:(NSString*)str lineSpacing:(CGFloat )lineSpacing Font:(UIFont*)font Width:(CGFloat)width ;
/**
 *设置带行间距的属性字符串
 */
+ (NSMutableAttributedString *)setAttributedStringWithString:(NSString *)aString linespace:(CGFloat )linespace font:(UIFont *)font;
/**
 *时间戳转时间
 */
+ (NSString *)timeStampStringToLocalTime:(NSString *)timeStampString;

+ (BOOL)isNum:(NSString *)checkedNumString;
//比较两个日期的大小
+ (BOOL)compareDate:(NSDate*)stary withDate:(NSDate*)end;
//获取当前window
+(UIWindow*)getCurrentWindow;
/**
 *获取状态栏高度
 */
+ (CGFloat )getStatusHeight;

+(CGSize)downloadImageSizeWithURL:(id)imageURL;
@end

NS_ASSUME_NONNULL_END
